﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChartSharp.QR
{
    public enum ErrorCorrectionLevel
    {
        L,
        M,
        Q,
        H,
    }

    public class QROptions : ChartParam
    {
        public const int MinimalMargin = 4;

        private readonly ErrorCorrectionLevel _errorCorrectionLevel;
        private readonly int _margin;


        public override string Name
        {
            get { return "chld"; }
        }

        public override string Data
        {
            get { return string.Format("{0}|{1}", _errorCorrectionLevel, _margin); }
        }

        public QROptions(ErrorCorrectionLevel level, int margin)
        {
            _errorCorrectionLevel = level;
            _margin = margin > MinimalMargin ? margin : MinimalMargin;
        }
    }
}
